1. Field of the Invention
The present invention relates to key input units, and more particularly, to an apparatus and method for decoding a key press.
2. Description of the Related Art
FIG. 1 illustrates the construction of a general apparatus for decoding a key press.
As shown in FIG. 1, a conventional apparatus for decoding a key press includes a controller 10 having an output unit with a certain number of output pins (KBC_0-KBC_4) for outputting a signal and an input unit with a certain number of input pins (KBR_0-KBR_4) for receiving a signal, and a key input unit 20 for connecting one of the output pins to one of the input pins when a key is pressed by a user.
The output pins and the input pins connect to the key input unit 20 in a matrix arrangement. The key input unit 20 includes a plurality of switches, corresponding to keys or push-buttons, which connect the output pins to the input pins.
The key press decoding apparatus constructed as described above operates as follows.
The controller 10 outputs signals through the output pins (KBC_0-KBC_4) of the output unit. In a condition in which no keys are pressed, no output signals are connected to any of the input pins (KBR_0-KBR_4) of the input unit, and a low level signal is applied to each of the input pins.
When a key of the key input unit 20 is pressed, a corresponding switch connects one of the output pins to one of the input pins. This pulls the output signal of the output pin connected to the pressed key to a low level, which causes an interrupt to be generated by the controller. When the interrupt is generated, the controller 10 determines which of the output pins is at the low level, in order to determine which of the output pins connects to the pressed key.
The controller 10 then determines which input pin is connected to the pressed key, by determining which input pin connects to the determined output pin. To do this, the controller changes the signal of each input pin, one by one, and determines which input pin causes a signal of the determined output pin to change. Since there are five input pins (KBR_0-KBR_4) and five output pins (KBC_0-KBC_4), this requires the controller 10 to examine up to 25 combinations of pins.
If the key input unit 20 includes 25 keys arranged in a 5×5 matrix, the controller 10 must have 10 pins (five input pins and five output pins). However, if one expands the number of keys, more controller pins are required. For example, if a key input unit 20 include 64 keys arranged in a 8×8 matrix, the controller 10 must have 16 pins (eight input pins and eight output pins).
As technology advances, many electronic devices, such as mobile terminals, are being provided with a greater number of features, and there is a corresponding need to increase the number of keys, or buttons, on these electronic devices. As discussed above, expanding the number of keys of a key input unit requires more controller pins. However, increasing the number of pins on a controller carries with it degraded performance of the controller. Further, if more pins of a controller are allocated for a key input unit, this takes away from the number of pins available for other functions.